#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<cmath>
#include<algorithm>
#include<cstdio>
#include<cstring>
using namespace std;
int n;
double minl = 10000000000;
struct Node
{
	double x;
	double y;
}dot[200010];
int compare(const void* p1, const void* p2)
{
	if (((struct Node*)p1)->x >= ((struct Node*)p2)->x)return 1;
	else return -1;
}
int main()
{
	cin >> n;
	for (int i = 0; i < n; i++)
		scanf("%lf%lf", &dot[i].x, &dot[i].y);
	qsort(dot, n, sizeof(struct Node), compare);
	for (int i = 0; i < n - 1; i++) {
		if (i + 3 < n) {
			for (int j = 1; j < 4; j++) {
				double digit = (dot[i].x - dot[i + j].x) * (dot[i].x - dot[i + j].x) + (dot[i].y - dot[i + j].y) * (dot[i].y - dot[i + j].y);
				minl = min(minl, sqrt(digit));
			}
		}
		else {
			double digit = (dot[i].x - dot[n - 1].x) * (dot[i].x - dot[n - 1].x) + (dot[i].y - dot[n - 1].y) * (dot[i].y - dot[n - 1].y);
			minl = min(minl, sqrt(digit));
		}
	}
	printf("%.4f", minl);
	return 0;
}